package appmgr

import (
	"github.com/msbranco/goconfig"
	l "util/log"
)

type Config struct {
	SvrIp   string
	SvrPort int
}

func (cfg *Config) Load() bool {
	c, err := goconfig.ReadConfigFile("center.cfg")
	if err != nil {
		l.TraceInfo("center", "load center.cfg error")
		return false
	}

	cfg.SvrIp, _ = c.GetString("net", "ip")
	p, _ := c.GetInt64("net", "port")
	cfg.SvrPort = int(p)
	return true

}

func CreateConfig() *Config {
	return &Config{}
}
